package cn.wuyi.item.consumer.feign;

import org.springframework.stereotype.Component;

import feign.hystrix.FallbackFactory;

@Component
public class AdminClientReasonImpl implements FallbackFactory<AdminClient> {
    @Override
    public AdminClient create(Throwable throwable) {
        return new AdminClient() {
            @Override
            public String sayHi(String message) {
                return "Hi，your message is :\"" + message + "\" but request error.fallback; reason was: " + throwable.getMessage();
            }
        };
    }
}
